home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #12 / Amiga Plus CD - 2002 - No. 12.iso / Tools / Freeware / PerfectPaint / rexx / Anim / Dissolve / Twirl < prev    next >
Encoding:
Text File  |  2001-10-01  |  1.5 KB  |  111 lines

  1. /* Dissolve Circle
  2. 100
  3. */
  4.  
  5.     call addlib("rexxmathlib.library", 5, -30, 0)
  6.  
  7.     options results
  8.  
  9.     parse ARG Port Opt1 Opt2 Opt3 s0 t0 s1 t1 b
  10.     
  11.     ADDRESS value Port
  12.  
  13.     pp_GetWidth
  14.     w=result
  15.     pp_GetHeight
  16.     h=result
  17.     pp_GetDepth
  18.     D=result
  19.  
  20.     pp_GetCurrentBuffer
  21.     CBf=result
  22.     pp_GetCurrentBrush
  23.     CB=result
  24.  
  25.     pp_FindEmptyBrush
  26.     Brush=result
  27.     if Brush=-1 then DO
  28.         pp_Warn "can't*find*empty|Brush."
  29.         EXIT        
  30.     END
  31.     pp_SetBrush Brush        
  32.  
  33.     pp_FindEmptyBuffer
  34.     Bf=result
  35.     if Bf=-1 then DO
  36.         pp_Warn "can't*find*empty|Buffer."
  37.         EXIT        
  38.     END
  39.     pp_SetBuffer Bf
  40.  
  41.     pp_New w+100 h+100 24
  42.     pp_SpareOnOff
  43.  
  44.     /* Draw your Mask */
  45.         pp_ClearRange 0
  46.         pp_setRange 0 0 0 0 0
  47.         pp_setRange 0 19 255 255 255
  48.         pp_Gradient 0 0 0 0
  49.  
  50.         pp_EffectOn
  51.         pp_ComposeReqOff
  52.         pp_BoxF 0 0 w+99 h+99
  53.         pp_Twirl 300
  54.         pp_Boxf 50 50 w+50 h+50
  55.         pp_pickBrush 50 50 w h 1
  56.         pp_new w h 24
  57.         pp_SpareOnOff
  58.         pp_pent 6
  59.         pp_Plot w/2 h/2
  60.         pp_FreeBrush
  61.         pp_ComposeReqOn
  62.         pp_EffectOff
  63.  
  64.     /*    End    */
  65.     
  66.     pp_SparetoStencil
  67.     pp_SSave "ram:DisSten"
  68.     pp_ClearCurrentBuffer
  69.     pp_SetBuffer CBf
  70.  
  71.     pp_SLoad "ram:DisSten"
  72.     ADDRESS COMMAND
  73.     'delete >nil: ram:DisSten'
  74.     ADDRESS value Port
  75.  
  76.     pp_GotoFrame s1
  77.     pp_PicttoSpare
  78.     pp_GotoFrame s0            
  79.     pp_Pickbrush 0 0 W H 1
  80.     
  81.     step=(s1-s0)
  82.     Step_f=255/Step
  83.  
  84.     DO i=s0 to s1
  85.         IF t1=1 then DO
  86.             pp_GotoFrame (s1+i-s0)
  87.             pp_PicttoSpare
  88.         END
  89.  
  90.         pp_GotoFrame i
  91.  
  92.         IF t0=0 then DO
  93.             pp_plot W/2 H/2
  94.         END
  95.  
  96.         f=Step_f*(i-s0)
  97.         IF Opt1=0 then DO
  98.             pp_Dissolve f 255            
  99.         END
  100.         ELSE DO
  101.             pp_Dissolve f f
  102.         END
  103.         pp_Refresh
  104.     END
  105.  
  106.         pp_Gotoframe s0
  107.         pp_FreeBrush
  108.         pp_SetBrush CB
  109.  
  110.     EXIT
  111.